//
//  RegisterViewController.m
//  HdMovie
//
//  Created by Classic on 1/8/13.
//  Copyright (c) 2013 Hoang tuan. All rights reserved.
//

#import "RegisterViewController.h"

@interface RegisterViewController ()

@end

@implementation RegisterViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    UIView *paddingView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)] autorelease];
    _txtFldEmail.leftView = paddingView;
    _txtFldEmail.leftViewMode = UITextFieldViewModeAlways;
    UIView *paddingView1 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)] autorelease];
    _txtFldPass.leftView = paddingView1;
    _txtFldPass.leftViewMode = UITextFieldViewModeAlways;
    UIView *paddingView2 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)] autorelease];
    _txtFldReEmail.leftView = paddingView2;
    _txtFldReEmail.leftViewMode = UITextFieldViewModeAlways;
    UIView *paddingView3 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)] autorelease];
    _txtFldRePass.leftView = paddingView3;
    _txtFldRePass.leftViewMode = UITextFieldViewModeAlways;
    UIView *paddingView4 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)] autorelease];
    _txtFldUserName.leftView = paddingView4;
    _txtFldUserName.leftViewMode = UITextFieldViewModeAlways;
    _txtFldUserName.delegate = self;
    _txtFldPass.delegate = self;
    _txtFldRePass.delegate = self;
    _txtFldEmail.delegate = self;
    _txtFldReEmail.delegate = self;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)textFieldDidBeginEditing:(UITextField *)textField
{
//    if ((textField == _txtFldEmail)||(textField == _txtFldReEmail))

        [_scroll setContentOffset:CGPointMake(0, +60) animated:YES];
    
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
//    if ((textField == _txtFldEmail)||(textField == _txtFldReEmail))

        [_scroll setContentOffset:CGPointMake(0, 0) animated:YES];
    
    return NO;
}

- (void)dealloc {
    [self setTxtFldUserName:nil];
    [self setTxtFldPass:nil];
    [self setTxtFldRePass:nil];
    [self setTxtFldEmail:nil];
    [self setTxtFldReEmail:nil];
    [self setScroll:nil];
    [super dealloc];
}
- (void)viewDidUnload {
    [self setTxtFldUserName:nil];
    [self setTxtFldPass:nil];
    [self setTxtFldRePass:nil];
    [self setTxtFldEmail:nil];
    [self setTxtFldReEmail:nil];
    [self setScroll:nil];
    [super viewDidUnload];
}
- (IBAction)regitClick:(id)sender {
    
}

- (IBAction)backClick:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
@end
